package com.cjm.one.service.impl;

import com.cjm.one.common.result.Result;
import com.cjm.one.custom.client.CustomerInfoClient;
import com.cjm.one.model.custom.dto.BindEmailDto;
import com.cjm.one.model.custom.dto.PasswordSetDto;
import com.cjm.one.model.custom.dto.PayPasswordSetDto;
import com.cjm.one.model.custom.entity.CustomerInfo;
import com.cjm.one.model.payment.BalanceDto;
import com.cjm.one.service.CustomerInfoService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service
public class CustomerInfoServiceImpl implements CustomerInfoService {
    @Resource
    private CustomerInfoClient customerInfoClient;
    @Override
    public Result<Boolean> passwordSet(PasswordSetDto passwordSetDto) {
        return customerInfoClient.passwordSet(passwordSetDto);
    }

    @Override
    public Result<Boolean> payPasswordSet(PayPasswordSetDto passwordSetDto) {
        return customerInfoClient.payPasswordSet(passwordSetDto);
    }

    @Override
    public Result<String> bindEmailSet(BindEmailDto passwordSetDto) {
        return customerInfoClient.bindEmailSet(passwordSetDto);
    }

    @Override
    public Result<CustomerInfo> updateCustomerInfo(CustomerInfo customerInfo) {
        return customerInfoClient.updateCustomerInfo(customerInfo);
    }

    @Override
    public Result<Boolean> addBalance(BigDecimal value) {
        return customerInfoClient.addBalance(value);
    }

    @Override
    public Result<Long> pay(BalanceDto balanceDto) {
        return  customerInfoClient.pay(balanceDto);
    }
}
